、<template>
	<view>
		<view class="friendlist">
			<view class="frienditem flex" v-for="(item,index) in friendlist" :key="index">
				<image class="avatar" v-if="item.type==1" src="/static/img/tongz/zs.png" mode=""></image>
				<image class="avatar" v-if="item.type==2" src="/static/img/tongzhi/zs.png" mode=""></image>
				<view class="right flex">
					<view class="rl">
						<view class="name">
							{{item.reason}}
						</view>
						<view class="time">
							{{item.createtime}}
						</view>
					</view>
					<view class="rr flex">
						+{{item.value}}
					</view>
				</view>
			</view>
		</view>
		<u-loadmore :status="status" @loadmore="scrolltolower" />
	</view>
</template>

<script>
	import {getAllScore} from '@/api/my.js'
	export default {
		data() {
			return {
				friendlist: [],
				page:1,
				last_page:1,
				status:'loadmore'
			};
		},
		methods:{
			getdata(){
				this.status='loading'
				getAllScore({team:1,page:this.page}).then(res=>{
					// console.log(res)
					this.status='loadmore'
					this.last_page=res.data.data.last_page
					this.friendlist=[...this.friendlist,...res.data.data.data]
					if(this.friendlist.length==0) this.status='nomore'
				})
			},
			scrolltolower(){
				this.page++
				if(this.page<=this.last_page){
					this.getdata()
				}else{
					this.status='nomore'
				}
			}
		},
		onLoad() {
			this.getdata()
		},
		onReachBottom() {
			this.scrolltolower()
		}
	}
</script>

<style lang="less">
	.friendlist {
		padding: 0 0 0 32rpx;

		.frienditem {
			align-items: flex-end;
			padding-top: 28rpx;
			border-bottom: 1rpx solid #F5F4F4;
		}

		.avatar {
			margin-right: 30rpx;
			width: 74rpx;
			height: 74rpx;
			align-self: flex-start;
		}

		.right {
			flex: 1;
			justify-content: space-between;
			padding-bottom: 30rpx;
			height: 74rpx;

			.rl {
				.name {
					font-size: 32rpx;
					color: #333333;
				}

				.time {
					font-size: 24rpx;
					color: #7A7878;
				}
			}

			.rr {
				color: #FB6419;
				font-size: 33rpx;
				font-weight: bold;
				padding-right: 30rpx;

				.jf_icon {
					width: 25rpx;
					height: 25rpx;
					margin-right: 7rpx;
				}

			}
		}
	}
</style>
